# 作者： 李泉志
# 2025年01月10日21时01分秒
# 2947029073@qq.com

# 3、练习单继承，多重继承案例（和上课保持一致即可）
class Animal:
    def __init__(self, name):
        self.name = name

    def eat(self):
        print(f"{self.name} is eating.")

    def run(self):
        print(f"{self.name} is running.")


class Dog(Animal):
    def __init__(self, name, color):
        super().__init__(name)
        self.color = color
        print(f"{self.color} {self.name} is born.")

    def bark(self):
        print(f"{self.name} is barking.")

    def run(self):
        print(f"dog:{self.name} likes running.")


class Cat(Animal):
    def __init__(self, name, color):
        self.eyes_color = color
        super().__init__(name)
        print(f"{self.eyes_color}eyes {self.name} is born.")

    def run(self):
        print(f"cat:{self.name} hates running.")


class A():
    def __init__(self, name):
        self.name = name
        print(f"A:{self.name} is born.")

    def run(self):
        print(f"A:{self.name} is running.")


class B(A):
    def __init__(self, name, nb, nc):
        super().__init__(name, nc)
        self.nb = nb
        print(f"B:{self.nb} is born.")

    def run(self):
        print(f"B:{self.nb} is running.")


class C(A):
    def __init__(self, name, nc):
        super().__init__(name)
        self.nc = nc
        print(f"C:{self.nc} is born.")

    def run(self):
        print(f"C:{self.nc} is running.")


class D(B, C):
    def __init__(self, name, nb, nc, nd):
        super().__init__(name, nb, nc)
        self.nd = nd
        print(f"D:{self.nd} is born.")



if __name__ == '__main__':
    dog = Dog("Buddy", "black")
    cat = Cat("Kitty", "white")

    dog.run()
    cat.run()

    dog.eat()
    cat.eat()

    dog.bark()

    d = D("A", 'B', 'C', 'D')
    d.run()
